/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */

#ifndef D_ID5DB_MISC_H
#define D_ID5DB_MISC_H

#include <sys/types.h>

#define LAST_ID_QUERY "SELECT id FROM record ORDER BY id DESC LIMIT 1"
#define LOG_LINE_LENGTH 32768
#define DATE_SIZE 256

struct snappy_compress_t
{
    char *src_filename;
    char *tgt_filename;
    int delete_src;
};

void id5db_misc_init(void);

void id5db_mysql_init(const char *, unsigned int, const char *, const char *, const char *);
int id5db_mysql_query(const char *, size_t);
uint64_t get_last_insert_id(void);

void id5db_misc_chdir(void);
void id5db_log(const char *, ...);
void id5db_file_compress(const char *, const char *);

#endif  /* id5db_misc.h */
